<script setup lang="ts">
import { computed } from 'vue'

type Prop = {
  prefix: string
  name: string
  color?: string
}
const props = withDefaults(defineProps<Prop>(), {
  prefix: 'icon'
})
const symbolId = computed(() => `#${props.prefix}-${props.name}`)
</script>

<template>
  <svg aria-hidden="true" class="cp-icon">
    <use :href="symbolId" :fill="color" />
  </svg>
</template>

<style lang="scss" scoped>
.cp-icon {
  width: 1em;
  height: 1em;
}
</style>
